<?
include("gestione/includes/config.inc.php");
include("gestione/includes/auth.lib.php");
include("gestione/includes/function.inc.php");
include("gestione/includes/product_new.class.php");
include("gestione/includes/e-commerce_new.class.php");
include("gestione/includes/news.class.php");
include("gestione/includes/content.class.php");
include("gestione/includes/keywords.class.php");
include("gestione/includes/class.xml.php");
$lang = "ita";
$cid = $_GET['cid'];
if($cid=="")
  $cid = 689;
####################### SESSION ##############################################################
$newSession = new websession();
$strNumArt = '<span class="ajax_cart_no_product">(vuoto)</span>';
$str_tot = 0;
if($newSession->order != NULL) {
	$articoli = $newSession->order->getArticoli();
	$numArt = count($articoli);
	$tot = $newSession->order->getTotale($articoli);
	$tot=="" ? $str_tot = 0 : $str_tot = number_format($tot,2,",",".");
	if($numArt>0) {
		$numArt>1 ?
		$strNumArt = '<span class="ajax_cart_quantity">'.$numArt.'</span> <span class="ajax_cart_product_txt">prodotti</span>' : 
		$strNumArt = '<span class="ajax_cart_quantity">'.$numArt.'</span> <span class="ajax_cart_product_txt">prodotto</span>';
	} else 
		$strNumArt = '<span class="ajax_cart_no_product">(vuoto)</span>';
}
if($newSession->getStatus())  {
	$registrati = '<li id="your_account"><a href="/webproduct.php?op=profile" title="Il tuo Profilo">Il tuo Profilo</a></li>
	<li id="header_user_info">
		Welcome '.$newSession->webuser->ragione.',
					(&nbsp;<a href="/webproduct.php?op=logout">Log out</a>&nbsp;)
			</li>';
	$tablelogin = '';
} else {
	$registrati = '<li id="your_account">&nbsp;</li>
	<li id="header_user_info">
		Welcome,
					(&nbsp;<a href="/webproduct.php?op=register">Login</a>&nbsp;)
			</li>';
}
################################ indicizzazione #####################################################
	 $newContent = new content(37);
	 $tagtitle = $newContent->tagtitle;
	 $tagkey = $newContent->tagkey;
	 $tagdesc = $newContent->tagdesc;
	 $metatitle = $newContent->metatitle;
	 $metakey = $newContent->metakey;
	 $metadesc = $newContent->metadesc;
	 $hidden = $newContent->hidden; 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="it" xmlns="http://www.w3.org/1999/xhtml"><head>
<? include("includes/header.php") ?>
</head>
<body>
<!--[if lt IE 7]><div style='clear:both;height:59px;padding:0 15px 0 15px;position:relative;z-index:10000;text-align:center;'><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/images/upgrade.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a></div><![endif]-->
<div id="wrapper1">
<div id="wrapper2">
<div id="wrapper3">
	<!-- Header -->
<? include("includes/top.php")?>
	<div id="columns">
<!-- Left -->
<? include("includes/left.php")?>
<!-- Center -->
<div id="center_column" class="center_column">
<?php 
	   $doc = new DOMDocument();
	   $doc->load( 'http://youtoys.bsvillage.com/getXmlBanner.php' );
	   $imgs = $doc->getElementsByTagName( "imgSlider" );
	   if ($imgs->length > 0) {
	   ?>
       <div id="slider-wrapper">
            <div id="slider" class="nivoSlider">
               <?php
                $listimages = "";			
                foreach( $imgs as $img ) {
                    $tagssrc = $img->getElementsByTagName( "src" );
                    $tagsrc = $tagssrc->item(0)->nodeValue;
                  
                    $tagstext = $img->getElementsByTagName( "text" );
                    $tagtext = str_replace("euro","&euro;",$tagstext->item(0)->nodeValue);
                  
                    $tagshref = $img->getElementsByTagName( "href" );
                    $taghref = $tagshref->item(0)->nodeValue;
                  
                    $listimages .= (!empty($taghref)?'<a href="'.$taghref.'">':'').'<img src="'.$tagsrc.'" title="'.utf8_decode($tagtext).'">'.(!empty($taghref)?'</a>':'')."\n";
                }
                echo $listimages;
                ?>
            </div>        
       </div>
       <?php } ?>
<div id="featured-products_block_center">
	<h4>Articoli in vetrina</h4>
		<div class="block_content">
		<ul><?=articoli::getNovitaHome($cid,$lang);?></ul>
	</div>
	</div>
<!-- /MODULE Home Featured Products -->		</div>
		<div class="clearblock"></div>
	</div>
</div>
<!-- Footer -->
	<div id="footer_wrapper">
<? include("includes/footer.php")?>
	</div>
</div>
</div>
	</body></html>